<%@ Page Language="C#" AutoEventWireup="true" CodeFile="HelpTypeList.aspx.cs" Inherits="admin_Help_HelpTypeList" %>

<%@ Register Src="../../Control/PageNo.ascx" TagName="PageNo" TagPrefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>帮助信息分类管理</title>
    <link rel="stylesheet" href="../skin/style.css" type="text/css" />
   <script type="text/javascript" src="../../js/jquery.js"></script>
    <script type="text/javascript">
     function $(id)
         {
            return document.getElementById(id);
         }
         function check()
         {
           if($("txtType").value=="")
           {
             document.getElementById("name").innerHTML="分类名称不能为空";
             return false;
           }
         }
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <div class="itemtitle">
            <h3>
                添加分类</h3>
        </div>
        <div class="itemtitle_tect">
            <p>
                分类名称：
                <asp:TextBox ID="txtType" runat="server"></asp:TextBox>
                <asp:Button ID="btnSave" runat="server" Text="添加" CssClass="i_button" OnClientClick="javascript: return check()" OnClick="btnSave_Click" />
                <asp:Button ID="btnCancel" runat="server" CssClass="i_button" Text="取消" OnClick="btnCancel_Click" />
            </p>
            <div id="name" style="color:Red; text-align:center;"></div>
        </div>
        <div class="clr">
        </div>
        <div class="partition">
            <div class="Option">
                <span><strong>快捷操作</strong></span> <span>
                    <asp:LinkButton ID="ButJS" runat="server">更新分类</asp:LinkButton>
                </span>
            </div>
        </div>
        <div class="clr">
        </div>
        <div class="talbe_border">
            <asp:GridView runat="server" ID="gvHelpTypeList" CellPadding="0" GridLines="None"
                HeaderStyle-CssClass="itemtitle" CssClass="talbe_list" AutoGenerateColumns="False"
                DataKeyNames="ID" OnRowEditing="gvHelpTypeList_RowEditing" OnRowUpdating="gvHelpTypeList_RowUpdating"
                OnRowCancelingEdit="gvHelpTypeList_RowCancelingEdit" OnRowDeleting="gvHelpTypeList_RowDeleting" OnRowCreated="gvHelpTypeList_RowCreated" OnRowDataBound="gvHelpTypeList_RowDataBound">
                <Columns>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:CheckBox ID="CheckBox1" runat="server" />
                        </ItemTemplate>
                        <HeaderStyle CssClass="th20 tou" />
                        <ItemStyle CssClass="nolet" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="分类名称">
                        <ItemTemplate>
                            <asp:HyperLink ID="hlk" runat="server" NavigateUrl='<%# Eval("ID", "HelpTypeList.aspx?ParentID={0}") %>'
                                Enabled='<%# IsCount( DataBinder.Eval(Container.DataItem, "time").ToString()) %>' Text=' <%# Eval("Name") %>'></asp:HyperLink>
                               
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtName" runat="server" Text='<%# Eval("Name") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemStyle CssClass="left2" />
                    </asp:TemplateField> 
                    <asp:TemplateField HeaderText="操作选项">
                        <EditItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update"
                                Text="更新"></asp:LinkButton>
                            <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel"
                                Text="取消"></asp:LinkButton>
                        </EditItemTemplate>
                        <ItemTemplate>
                             <asp:HyperLink ID="hlkAdd" runat="server" NavigateUrl='<%# Eval("ID", "HelpTypeList.aspx?ParentID={0}") %>'> 添加子分类</asp:HyperLink>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit"
                                Text="编辑"></asp:LinkButton>
                            <asp:LinkButton ID="lbtnDelete" Style="text-decoration: none" runat="server" Text="删除"
                                CommandArgument='<%# DataBinder.Eval(Container.DataItem,"ID") %>' OnClientClick="return confirm('你确定要删除吗?')"
                                CommandName="delete">
                            </asp:LinkButton>
                        </ItemTemplate>
                        <HeaderStyle CssClass="th180" />
                    </asp:TemplateField>
                </Columns>
                <HeaderStyle CssClass="header" />
            </asp:GridView>
            <div class="Paging">
                <p>
                    <uc1:PageNo ID="PageNo1" runat="server" />
                </p>
                <input id="CheckBox2" name="CheckBox2" onclick="SelectAll();" type="checkbox" />全选
                <asp:Button ID="btnDelete" runat="server" Font-Size="9pt" Text="批量删除" CssClass="i_button"
                    OnClick="btnDelete_Click" />
                 <asp:Label ID="lblMessage" runat="server" Visible="false"></asp:Label>
            </div>
        </div>
    </form>
</body>
</html>
